<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        .speech-recognition {
            width: 100%;
            height: 2.9rem;
        }
        .speech-content {
            padding-top: 0.1rem;
            height: 1.9rem;
            line-height: 1.5rem;
            text-align: center;
            margin: 0 auto;
            width: 266px;
            white-space:normal;
            word-break:break-all;
        }
    </style>
</head>
<body>
    <div class="speech-recognition">
        <div class="speech-content">给我推荐一款20万左右的产销suv给我推荐一款20万左右的产销suv</div>
    </div>
    <script>
        //写一个function,清楚字符串前后的空格  
        function str(arr) {
            if (arr && typeof arr === "string") {
                return arr.replace(/(^\s*)|(\s*)$/g, "");
            }
        }
        let tr = str("  frgt edea dcc  ");
        console.log(tr);
        console.log(" 123 456 ");
        // var  a='shue8';
        //typeof   判断类型
        a = true
        console.log(typeof (a));
    </script>
</body>

</html>